package
{
	import controller.DataCommand;
	import controller.StartupCommand;
	
	import org.puremvc.as3.interfaces.IFacade;
	import org.puremvc.as3.patterns.facade.Facade;
	import org.puremvc.as3.patterns.observer.Notification;
	
	import view.MenuView;

	public class ApplicationFacade extends Facade implements IFacade
	{
		public static const NAME:String 				= "ApplicationFacade";
		public static const STARTUP:String				= NAME + "Startup";
		public static const DATA_GET:String				= NAME + "DataGet";
		public static const DATA_READY:String			= NAME + "DataReady";
//		public static const ALIGNED:String				= NAME + "Aligned";
		
		public static const APP_WIDTH:Number			= 800;
		public static const APP_HEIGHT:Number			= 600;
		
		public static const SPEED:Number				= 0.3;
		
		public static const INIT:String					= NAME + "Init";
		
		public static function getInstance():ApplicationFacade
		{
			return ( instance ? instance : new ApplicationFacade() ) as ApplicationFacade
		}
		
		override protected function initializeController():void
		{
			super.initializeController();
			
			registerCommand( STARTUP, StartupCommand );
			registerCommand( DATA_GET, DataCommand );
		}
		
		public function startup( stage:Object ):void
		{
			sendNotification( STARTUP, stage );
		}
		
		override public function sendNotification( notificationName:String, body:Object=null, type:String=null ):void
		{
			notifyObservers( new Notification( notificationName, body, type ) );
		}
	}
}